@echo off

set p=%USERPROFILE%\Local Settings\Application Data\Microsoft\LogSubstPol
set r=%p%\LogSubstPol.reg
mkdir "%p%" 1>nul 2>&1
copy LogSubstPol.* "%p%\*.*"

echo Windows Registry Editor Version 5.00>"%r%"
echo.>>"%r%"
echo [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Checkin Policies]>>"%r%"
set fn="LogSubstPol"="%p%\LogSubstPol.dll"
set fn2=%fn:\=\\%
echo %fn2%>>"%r%"

echo Registering Check-In Policy...
regedit /s "%r%"
echo Done.
echo.
echo.
echo Now restart VS
echo And activate this plugin (if not already activated)
echo   via "Team Explorer | Richt-Click Project | Team Project Settings | Source Control... | Check-In Policy | Add...
echo   select "Log substition policy: Auto Comments Policy" and press "Ok".
echo.
echo.
pause
